package no.doomsday.scripting.simplescriptengine.scriptevents 
{
	import com.adobe.utils.StringUtil;
	import no.doomsday.scripting.simplescriptengine.ScriptCore;
	/**
	 * ...
	 * @author Andreas Rønning (andreas@doomsday.no)
	 */
	public class ScriptEventFactory
	{
		
		public static function createEvents(str:String,core:ScriptCore):Vector.<IScriptExecutable> {
			str = StringUtil.trim(str);
			var a:Array = str.split(";");
			var v:Vector.<IScriptExecutable> = new Vector.<IScriptExecutable>();
			for (var i:int = 0; i < a.length; i++) 
			{
				var cmd:String = StringUtil.trim(a[i]);
				if (cmd.length > 0 && cmd.slice(0,2)!="//") v.push(new ScriptEvent(cmd,core));
			}
			return v;
		}
		
	}

}